<?php

include 'islogin.php';

include '../config.php';

if(isset($_POST['flag']))

{

	if($_POST['flag']=='del')

	{

		$sql = "update en_custom_need set flag =0 where id=".$_POST['id'];

		mysql_query($sql);

		return;

	}

	 

}

?>

<link href="images/skin.css" rel="stylesheet" type="text/css" />

<link href="css/right.css" rel="stylesheet" type="text/css"/>

<script src="../js/jquery-1.7.1.js"></script>

<script>

function mouseoverTD(obj)

{

	   $(obj).css("background","#aaa");

}

function mouseoutTD(obj)

{

	  $(obj).css("background","");

}

function del(id,obj)

{

	  if(confirm("是否要删除此留言？"))

	  {

		  var url = "liuyan_list.php";

		  

		  $.post(url,{

			  		flag:'del',

			  		id:id

			  },function(data){

					$(obj).parents("tr").hide();

					

				  });

	  }

	  

}

function lookinfo(info,dates,names)

{

	$("#overlay").show();

	$("#push_div").show();

	$("#context").html(info);

	$("#shijian").html("<"+names+">"+dates);

	

}

function closePush()

{

	$("#overlay").hide();

	$("#push_div").hide();

	

}

</script>

<div style="border:0px solid red;position:relative;"> 



		<div id="top"><div>留言列表</div></div>

		

		 <div id="middle" style="">

		 	<div class="layout">

		 		<div class="title">客户留言</div>

		 		 <div class="content">

		 		 	<table  cellspacing="0" cellpadding="0"> 

		 		 		<tr >

		 		 			<td class="title_some_td" style="width:300px; text-align:center;">标题</td>

				   		   	<td class="title_some_td" style="width:200px; text-align:center;">客户姓名</td>

				   		   	<td class="title_some_td" style="width:100px; text-align:center;">联系电话</td>

				   		   	<td class="title_some_td" style="width:200px; text-align:center;">Email</td>

				   		   	<td class="title_some_td" style="width:100px; text-align:center;">操作</td>

				   		   </tr>

				   		   

				   		   <?php 

				   		   $sql = "select id,title,name,phone,email,content,dates,flag from en_custom_need where flag=1 order by dates desc";

				   		   $result= mysql_query($sql);

				   		   ?>

				   		    <?php 

				             while($row=mysql_fetch_array($result))

				             {

				             		echo "<tr style='cursor:pointer;'  onmouseover='mouseoverTD(this)' onmouseout='mouseoutTD(this)' ondblclick=lookinfo('".$row['content']."','".$row['dates']."','".$row['name']."') >";

				             		echo "<input type='hidden' value='".$row['id']."' />";

				             		echo "<td class='context_td'>".$row['title']."</td>";

				             		echo "<td class='context_td'>".$row['name']."</td>";

				             		echo "<td class='context_td'>".$row['phone']."</td>";

				             		echo "<td class='context_td'>".$row['email']."</td>";

				             		echo "<td class='context_td'><a style='text-decoration:underline;' href='javascript:return false;' onclick='del(".$row['id'].",this)'>删除</a></td>";

				             		echo "</tr>";

				             }

				           ?>

		 		 	</table>

		 		 </div>

		 	</div>

		 </div>

		 <div id="bottom"></div>

		 

		 <div id="push_div" style="position:absolute;z-index:99;width:420px;height:350px;background:white;left:350px;top:200px;border:1px solid rgba(234,238,250,0.6);border-radius:6px;-webkit-border-radius:6px;display:none;">

				<div style="background:url('images/cut_line.png') no-repeat 0 bottom ;padding:5px;">

	          		<div id="shijian" style="float:left;"></div><font style="font-size:15px;font-weight:bold;">留言</font><a href="javascript:return false;"  onclick="closePush()" style="color:#444;float:right;margin-right:5px;">X</a>

	      		</div>

	      		<div id="context" style="height:265px;">

	      		

	      		</div>

	      		<div style="background:url('images/cut_line.png') no-repeat 0 bottom ;width:420px;height:1px;">

	      			

	      		</div>

	      		<div style="text-align:center;margin-top:5px;">

	      		  <input type="button"  value="确定"  onclick="closePush()" style="width:80px;height:50px;" />

	      		</div>

		</div>		

</div>	

<div id="overlay" style="position:absolute;z-index:98;width:100%;height:100%;background-color:rgb(0,0,0); left:0px;top:0px;opacity:0.2;display:none;">

	

</div>

 